void setup() { // put your setup code here, to run once: pinMode (13, OUTPUT); pinMode (12, OUTPUT); pinMode (11, OUTPUT); pinMode (10, OUTPUT); pinMode (9, OUTPUT); pinMode (8, OUTPUT); } void loop() { // put your main code here, to run repeatedly: stepAhead () ; stepBack () ; stepAhead () ; stepBack () ; stepAhead () ; stepBack () ; stepAhead () ; stepBack () ; delay (1000); } void stepAhead () { //step ahead digitalWrite (12, HIGH); digitalWrite (13, LOW); digitalWrite (8, HIGH); digitalWrite (9, LOW); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); } void stepBack () { //step back digitalWrite (12, LOW); digitalWrite (13, HIGH); digitalWrite (8, LOW); digitalWrite (9, HIGH); //turn on the motors digitalWrite (11, HIGH); digitalWrite (10, HIGH); delay (100); //turn off the motors digitalWrite (11, LOW); digitalWrite (10, LOW); delay (430); }